<?php
require_once "db.php";

$movie_name = db_escape($_POST['ch_mov']);
$movie_state = db_escape($_POST['movie_state']);
$ppf2 = 0;
if ($movie_state == 'current') {
	$ppf2 = 1;
}
else if ($movie_state == 'upcoming') {
	$ppf2 = 2;
}
else if ($movie_state == 'past') {
	$ppf2 = 3;
}
else if ($movie_state == 'premiere') {
	$ppf2 = 4;
}
$query = "UPDATE movies SET `past_present_future`='$ppf2' WHERE `movie_name`='$movie_name'";
$result = db_query($query);
echo "You change the state of ".$movie_name." to ".$movie_state;
